package PTA_5;

import java.util.Scanner;

public class t2 {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		String s = scan.nextLine();
		char[] ch = s.toCharArray();
		for(int i = 0;i < ch.length;i++) {
			if(ch[i] >='a' && ch[i] <= 'z') {
				ch[i] -= 32;
			} else if(ch[i] >='A' && ch[i] <= 'Z') {
				ch[i] += 32;
			}
		}
		String put = new String(ch);
		StringBuffer sb = new StringBuffer(put).reverse();
		put = sb.toString();
		System.out.println(put);
	}
}
